<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <script src="../../dist/jsoneditor.js"></script>
</head>
<body>

<textarea class="debug" cols="30" rows="10"></textarea>
<button class='get-value'>Get Value</button>
<div class='container'></div>

<script>
  var container = document.querySelector('.container');
  var debug = document.querySelector('.debug');
  var schema = {
    "type": "array",
    "title": "Strings",
    "format": "table",
    "items": {
      "type": "string",
      "title": "String"
    }
  };
  var editor = new JSONEditor(container, {
    schema: schema,
    enable_array_copy: true
  });
  document.querySelector('.get-value').addEventListener('click', function () {
    debug.value = JSON.stringify(editor.getValue());
  });
  editor.setValue(["A","B","C","D","E"]);
  editor.on('copyRow', function () {
    alert('copyRow');
    console.log('copyRow');
  });
  editor.on('moveRow', function () {
    alert('moveRow');
    console.log('moveRow');
  });
  editor.on('addRow', function () {
    alert('addRow');
    console.log('addRow');
  });
  editor.on('deleteRow', function () {
    alert('deleteRow');
    console.log('deleteRow');
  });
  editor.on('deleteAllRows', function () {
    alert('deleteAllRows');
    console.log('deleteAllRows');
  });
</script>

</body>
</html>
